#include <stdio.h>
#include <string.h>
#include <unistd.h>

#define NUM 101
#define STYLE '='

void process()
{
   char bar[NUM];
   memset(bar, '\0', sizeof(bar));
   char sigh[4] = "|/-\\";

   int cnt = 0;
   while(cnt <= 100)
   {
      printf("[%-100s][%d%%] %c\r", bar, cnt, sigh[(cnt/2)%4]);
      fflush(stdout);
      bar[cnt++] = STYLE;

      usleep(20000);
   }
   printf("\n");
}


int main()
{
  process(); 

  return 0;
}
